package com.learn.shop.controller;

import com.github.pagehelper.PageInfo;
import com.learn.shop.constant.R;
import com.learn.shop.pojo.entriy.SNovelCrawlingHistory;
import com.learn.shop.pojo.vo.PageVo;
import com.learn.shop.service.SNovelCrawlingHistoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("history")
@Api(tags = "历史获取")
public class SNovelCrawlingHistoryController {

    @Autowired
    private SNovelCrawlingHistoryService sNovelCrawlingHistoryService;

    @PostMapping("/list")
    @ApiOperation("获取历史小说分页")
    public R<PageInfo<SNovelCrawlingHistory>> list(@RequestBody PageVo pageVo) {
        PageInfo<SNovelCrawlingHistory> list = sNovelCrawlingHistoryService.list(pageVo);
        return R.ok(list);
    }
}
